/*
 * 项目名称:    wms-server-jeecg
 * 创建人员:    DongPeng
 * 创建时间:    2023-09-21
 * copyright(c) 2022 无锡星智数服科技有限公司
 */
package org.jeecg.modules.dock.controller;

import com.dtflys.forest.annotation.Header;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.dock.client.MesRequestClient;
import org.jeecg.modules.dock.entity.mes.request.MaterialZJPlanProductionLine;
import org.jeecg.modules.dock.entity.mes.request.MesBaseRequestVO;
import org.jeecg.modules.dock.entity.mes.response.MaterialZJPlanProductionLineDetails;
import org.jeecg.modules.dock.entity.mes.response.MesBaseResponseVO;
import org.jeecg.modules.dock.service.MesDockingRepeaterService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 内部对接mes控制器
 *
 * @author DongPeng
 * @version 1.0.0
 * @date 2023-09-21
 * @description 类描述
 */
@Slf4j
@RestController
@RequestMapping("dock/repeater")
@RequiredArgsConstructor
@Api(tags = "Mes业务调用模块")
public class MesDockingRepeaterController {

    private final MesDockingRepeaterService mesDockingRepeaterService;

    /**
     * 获取原卷纵剪计划产线
     *
     * @param request 请求参数
     * @return
     * @author DongPeng
     * @date 2023/10/10 15:46
     */
    @ApiOperation(value = "获取Mes原卷纵剪计划产线", notes = "获取Mes原卷纵剪计划产线")
    @PostMapping("/getMaterialZJPlanProductionLine")
    public List<MaterialZJPlanProductionLineDetails> getMaterialZJPlanProductionLine(@RequestBody MaterialZJPlanProductionLine request) {
        return mesDockingRepeaterService.getMaterialZJPlanProductionLine(request);
    }

    @ApiOperation(value = "任务状态更新", notes = "任务状态更新")
    @PostMapping("/updateStatus")
    public MesBaseResponseVO updateStatus(@RequestBody MesBaseRequestVO requestVO) {
        mesDockingRepeaterService.updateStatus(requestVO);
        return MesBaseResponseVO.ok();
    }

    /**
     * 包装托盘码查询
     *
     * @author hansen
     * @since 2024/1/12 10:06
     * @param palletCodeQuery
     * @return org.jeecg.modules.dock.entity.mes.response.MesBaseResponseVO
     */
    @ApiOperation(value = "包装托盘码查询", notes = "包装托盘码查询")
    @PostMapping("/palletCodeQuery")
    public MesBaseResponseVO palletCodeQuery(@RequestParam("packageCode") String palletCodeQuery) {
        mesDockingRepeaterService.palletCodeQuery(palletCodeQuery);
        return MesBaseResponseVO.ok();
    }
}
